Learn What is Database Table? How to Create a Database Table using SQL?

Опубликовано: 29 Сентябрь 2024
на канале: PnTutorials by Pradnyankur Nikam
8,626
20

Learn how to create the database table using SQL statement. The CREATE TABLE statement is used to create a database table. A valid database table name may contain only letters, numbers and underscore symbol. The database table names are case insensitive. That is table name 'students' (all small letters) is similar to the table name 'StuDenTs' (the letters S, D and T are capital). A single database must contain a unique table name, while in multiple databases, the same table name can exist in another database.

The SQL statement to create new database table is,
CREATE TABLE tablename ( columnname1 datatype, columnname2 datatype );
Select 'school' database, "USE school;"
create a new table called 'students3' with only 2 columns, studentid and firstname. The SQL statement will be,
CREATE TABLE students3 ( studentid SMALLINT(5), firstname VARCHAR(20) );
If we display all the tables, "SHOW TABLES;". We can see the new table named 'students3' is successfully created.
We can display the information about table structure by using SQL statement,
"DESCRIBE students3;" OR "EXPLAIN students3;"

Check out the whole playlist of SQL Tutorials or Individual video from the following links,

SQL Tutorial for Beginners. Introduction to SQL Basics
   • SQL Tutorial for Beginners. Introduct...  

1.Learn What is SQL? Introduction to SQL
   • Learn What is SQL? Introduction to SQL  

2.Learn How to Install MySQL Database Server on Windows Operating System
   • Learn How to Install MySQL Database S...  

3.Learn What is Database? How to Create and Show Databases using SQL
   • Learn What is Database? How to Create...  

4.Learn How to Select and Use Existing Database using SQL
   • Learn How to Select and Use Existing ...  

5.Learn How to Delete or Remove Database using SQL
   • Learn How to Delete or Remove Databas...  

6.Learn What is Database Table? How to Create a Database Table using SQL?
   • Learn What is Database Table? How to ...  

7.Learn How to Modify or Update Database Table using SQL
   • Learn How to Modify or Update Databas...  

8.Learn How to Delete or Remove Database Table using SQL
   • Learn How to Delete or Remove Databas...  

9.Learn How to Add Data Rows in a Table using SQL
   • Learn How to Add Data Rows in a Table...  

10.Learn How to Use INSERT INTO SELECT Statement in SQL
   • Learn How to Use INSERT INTO SELECT S...  

11.Learn How to Update Data Rows using Update Statement in SQL
   • Learn How to Update Data Rows using U...  

12.Learn How to Delete Data Rows using Delete Statement in SQL
   • Learn How to Delete Data Rows using D...  

Subscribe to my channel:    / @pntutorialsbypradnyankurnikam