DDL OPERATIONS: The various DDL commands are CREATE, ALTER and DROP. Let us learn about each DDL Command one by one with examples. CREATE Statement: The CREATE statement in SQL is used to create the database and the database objects like Tables, Views, Sequences, etc. Let us see how a database and table are created in SQL. Creating a database in SQL: Syntax: CREATE DATABASE DatabaseName; Example: CREATE DATABASE Demos; On executing this query, a database named "Demos" is created. Creating Table in SQL: Database is a collection of related tables and other objects. This implies that a table is a part of the database. Now, we have created the "Demos" database. And, we need to create a "Students" table in this database. By default, the master database is selected. Select Demos database from the dropdown list or alternatively you can use the following command: Use Demos; This ...
Comments
Post a Comment