{"id":124243,"date":"2023-04-28T10:00:22","date_gmt":"2023-04-28T04:30:22","guid":{"rendered":"https:\/\/www.aplustopper.com\/?p=124243"},"modified":"2023-04-29T09:53:10","modified_gmt":"2023-04-29T04:23:10","slug":"plus-two-computer-application-notes-chapter-9","status":"publish","type":"post","link":"https:\/\/www.aplustopper.com\/plus-two-computer-application-notes-chapter-9\/","title":{"rendered":"Plus Two Computer Application Notes Chapter 9 Structured Query Language"},"content":{"rendered":"

Kerala Plus Two Computer Application Notes Chapter 9 Structured Query Language<\/h2>\n

SQL – Structured Query Language developed at IBM\u2019s San Jose Research Lab.<\/p>\n

The result of the compilation of DDL statements is a set of tables, which are stored in a special file called data dictionary.<\/p>\n

Creating a database in Mysql
\nCREATE DATABASE <database_name>;
\nEg: mysql>CREATE DATABASE BVM;<\/p>\n

Opening a database
\nUSE command used to use a database
\nUSE <database_name>;
\nEg: mysql>USE BVM;<\/p>\n

SHOW command is used to list entire database in our system.
\nmysql>SHOW DATABASES;<\/p>\n

Data Types<\/span><\/p>\n

1. Char – It is used to store fixed number of characters. It is declared as char(size).<\/p>\n

2. Varchar – It is used to store characters but it uses only enough memory.<\/p>\n

3. Dec or Decimal – It is used to store numbers with decimal point. It is declared as Dec (size, scale). We can store a total of size number of digits.<\/p>\n

4. Int or Integer – It is used to store numbers with\u00acout decimal point. It is declared as int. It has no argument. Eg: age int.<\/p>\n

5. Smallint – Used to store small integers.<\/p>\n

6. Date – It is used to store date. The format is yyyy-mm-dd.
\nEg: \u20181977-05-28\u2019.<\/p>\n

7. Time – It is used to store time. The format is<\/p>\n

DDL commands (3 commands)<\/p>\n