Get the App
SLTechnology News&Howtos  ›  Database  › 

The method of creating student table with SQL statement

Shulou Source: shulou.com Published: 2022-06-01 01:44:43 10月03日 Update

This article mainly introduces the method of creating student table with SQL sentence, which is very detailed and has certain reference value. Friends who are interested must finish reading it.

Steps: 1, open "sql server"; 2, use "creat table student ();" to create a table; 3, use "char ()" to define the type of name, sex, and age; 4, use "insert into student values ();" to define table attributes.

Steps:

Create table Student (Sno char (10), Sname varchar (20), Ssex char (2), Sage tinyint, Sdept varchar (20),) insert into Student values ('201215121','Li Yong', 'male','20'), ('2012 15122', 'Liu Chen', 'female','19'), ('201215123', 'Wang Min', 'female','18'), ('201215125' Zhang Li, 'male', '19') 'IS')

Let's open the new query of sql

Let's build a table called student.

We enter the student number and name, and the type is represented by characters.

We enter gender, age, and major, which are defined by the appropriate type.

At this time, we press the execution.

We can see that the system shows that the table has been built successfully.

The above is all the contents of the article "how to create a student table with sql sentences". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Type student method sentence content name age gender step article input success major value interest student number buddy partner attribute more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Huawei Shulou Information NVidia Apple