Home » Create a Schema and table in Azure Data Lake Database

Create a Schema and table in Azure Data Lake Database

Create a Schema and table in Azure Data Lake Database





To create a Schema and table in Azure Data Lake, first you must have a database.

You can create a database and if you do not know how to create one, you can refer the post Create Database in Azure Data Lake.

Lets create a schema and tables in Azure data lake database.

Go to Home page, select ResourceGroup under that click on Data Lake Analytics Account, here we have an account named as azuredatalakeacc.

Next click on New Job.

 

 

After that, a New Job page opens, next specify a name for jobs, named as createtable.

In code editor, now we will write a U-SQL Scripts that creates a schema named as Stud, and a table named as studentInfo under the schema in Database Db_Live.

 

USE DATABASE Db_live;

CREATE SCHEMA IF NOT EXISTS Stud;

CREATE TABLE Stud.StudentInfo

(

    StudID int,

    StudName string,

    StudAddress String,

    RegDate DateTime,

    INDEX idx_StudID CLUSTERED(StudID ASC) DISTRIBUTED BY HASH(StudID)

);
After providing a Job names, and writing create schema and table queries click on Submit button.
Once you click on Submit button, A jobs is executed and you will see a job status as succeeded when job is completed successfully.
Now go back to Data Analytics Account, then click on Data Explorer, under that click on U-SQL catalog.
Then click on Database Db_Live, You will see a table StudentInfo that you created.
If you want to see the columns that you have in table, just expand the Database db_Live and click on columns.




Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.