DBMS Flashcards
What is SQL
SQL stands for Structured Query Language. SQL is a database computer language designed for the retrieval and management of data in a relational database
What are the data types in SQL?
Data Types in SQL:
● Int - integer (example: marks of a student)
● Float - decimal values (2.09, 1.35, 1.75)
● Date - for entering date (format: yyyy-MM-DD)
● Char - for characters, if we want to enter a string, we have to enter the number of letters the string has. Example: If you are entering CAR, then you have to enter 3, as there are 3 letters in CAR. It will leave 3 spaces for the car. Maximum
number of characters are 0 to 255.
● Varchar - for characters, if we want to enter a string, we have to enter the number of letters the string has. Example: If you are entering CAR, then you
have to enter 3, as there are 3 letters in CAR. It will leave 3 spaces for the car.
The maximum number of characters is 0 to 65535.
What is DDL?
DDL stands for Data Definition Language. These commands are used to change the structure of a database and database objects. For example, DDL
commands can be used to add, remove, or modify tables within a database.
What are the constraints in MYSQL
Constraints in Mysql
● Not Null - ensures that column has an appropriate value
● Unique - ensure that columns should have a distinct value, not the same
● Primary key - identifies each row uniquely
● Default - used to fill a column with default and fixed value
What is DML
A data manipulation language (DML) is a computer programming language used for adding (inserting), deleting, and modifying (updating) data in a database.
What are the DML commands
DML Commands
Insert - Inserts data in tables (Insert into table_name values();)
Modify - Adding a constraint to a column
(Alter table table_name modify column_name type() constraint;)
Delete - Deletes a table