Get the App
SLTechnology News&Howtos  ›  Database  › 

What is the method of creating a student table with SQL statements

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

The editor will share with you what is the method of creating a student table with SQL sentences. I hope you will gain a lot after reading this article. Let's discuss it together.

The code for creating a student table using SQL statements in the database is as follows:

(student number char (12) primary key, name char (6) not null, gender char (2) check (gender IN ('male', 'female'), class char (15))

Creation of related tables:

Create table score sheet (student number char (12) references student table (student number), course number char (2) references curriculum schedule (course number), grade int default (30), primary key (course number, course number) create table curriculum schedule (course number char (2) primary key, course name char (20), credit int check (credit > = 1 and credit)

Tags: Grades courses students student numbers course schedules sentences credits methods names gender data databases articles lowest highest code done average more highest score Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Redmi Shulou Tech Info MySQL Apple