Git Product home page Git Product logo

f2_dbms's Introduction

EXP NO 1: DATA DEFINITION LANGUGE COMMANDS IN RDBMS

AIM:

To create a student database and execute DDL queries using SQL.

DDL (Data Definition Language)

DDL or Data Definition Language actually consists of the SQL commands that can be used to define the database schema. It simply deals with descriptions of the database schema and is used to create and modify the structure of database objects in the database. DDL is a set of SQL commands used to create, modify, and delete database structures but not data. These commands are normally not used by a general user, who should be accessing the database via an application.

List of DDL commands:

CREATE: This command is used to create the database or its objects (like table, index, function, views, store procedure, and triggers).
DROP: This command is used to delete objects from the database.
ALTER: This is used to alter the structure of the database.
TRUNCATE: This is used to remove all records from a table, including all spaces allocated for the records are removed.
RENAME: This is used to rename an object existing in the database.

Query:

1) Create a table student with the following fieds rollno,name,age,address,phoneno.

SQL QUERY:

create table student(roll_no numeric(5),name varchar(50),age numeric(2),address varchar(50),ph_no numeric(10));

OUTPUT:

1

2) Change the above student table by adding another attribute department

SQL QUERY:

alter table student add department varchar(5);

OUTPUT:

2

3) Drop the student table

SQL QUERY:

drop table student;

OUTPUT:

3

4) Delete the student table using truncate keyword

SQL QUERY:

truncate table student;

OUTPUT:

4

5) Rename the student table to mystudent

SQL QUERY:

alter table student rename to mystudent;

OUTPUT:

5

RESULT:

To create a student database and execute DDL queries using SQL is executed success

f2_dbms's People

Contributors

janarthanan2 avatar dineshgl avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.