


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Learn about the sql create command, which is used to create databases and tables in relational database management systems. Discover the syntax and examples for creating databases and tables, as well as the most commonly used datatypes for table columns.
Typology: Assignments
1 / 4
This page cannot be seen from the preview
Don't miss anything!



create is a DDL SQL command used to create a table or a database in relational database management system.
To create a database in RDBMS, create command is used. Following is the syntax, CREATE DATABASE <DB_NAME>; Example for creating Database CREATE DATABASE Test; The above command will create a database named Test , which will be an empty schema without any table. To create tables in this newly created database, we can again use the create command.
create command can also be used to create tables. Now when we create a table, we have to specify the details of the
columns of the tables too. We can specify the names and datatypes of various columns in the create command itself. Following is the syntax, CREATE TABLE <TABLE_NAME> ( column_name1 datatype1, column_name2 datatype2, column_name3 datatype3, column_name4 datatype ); create table command will tell the database system to create a new table with the given table name and column information. Example for creating Table CREATE TABLE Student( student_id INT, name VARCHAR( 100 ), age INT);
INT used for columns which will store integer values. FLOAT used for columns which will store float values. DOUBLE used for columns which will store float values. VARCHA R used for columns which will be used to store characters and integers, basically a string. CHAR used for columns which will store char values(single character). DATE used for columns which will store date values. TEXT used for columns which will store text which is generally long in length. For example, if you create a table for storing profile information of a social networking website, then for about me section you can have a column of type TEXT.