Before starting with databases,
I studied by writing a blog based on the exercises included in a Linux bootcamp.
As I wrote the practice blog on Linux,
I realized that to create a useful blog post not only for others but also for myself,
it’s better to include both concepts and practical exercises.
With that in mind, I now plan to organize and write about the concepts as well.
Enough with the preamble, let's dive into the concepts related to databases.
What is a Table?
A table is a structured format within a database that stores related data.
The columns of a table are made up of headers (e.g., name, age),
and the actual data values are entered in the rows of the table.
Difference Between SQL and MySQL
The difference between SQL and MySQL can be seen as a distinction
between a language and an operating system. While case sensitivity is not important,
it’s common practice to write commands in uppercase and everything else in lowercase.
Also, don’t forget to end each command with a semicolon.
<Commands Related to Creating Databases>
- 'SHOW DATABASES;' - View the databases that MySQL has.
- 'CREATE DATABASE database_name;' - Create a database.
- 'DROP DATABASE database_name;' - Delete a database.
- 'USE database_name;' - Use the specified database.
- 'SELECT DATABASE();' - Check which database is currently in use.
- 'CREATE TABLE table_name;' - Create a table.
- 'SHOW TABLES;' - View the tables.
- 'SHOW COLUMNS FROM table_name;' - View the table data.
- 'DESC table_name;'` - Same as the command above.
- 'DROP TABLE table_name;' - Delete a table.
- '--' - Add this before a command to comment it out.
- 'Ctrl + /' - Comment out multiple lines at once.
'Database' 카테고리의 다른 글
SQL_Read, Update, Delete (0) | 2024.08.23 |
---|---|
SQL_Data insertion in Table (0) | 2024.08.12 |