Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update SQL Basics Create Table and Insert Into #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Imran-imtiaz48
Copy link

I combined both table creation queries and the data insertion queries into one unified script, which includes:

  1. Table Creation Statements:

    • EmployeeDemographics table with primary key, NOT NULL constraints, and checks for valid age and gender values.
    • EmployeeSalary table with a primary key, NOT NULL constraints, a CHECK constraint for valid salary, and a foreign key relationship linking EmployeeID to EmployeeDemographics.
  2. Data Insertion Statements:

    • Insert statements for both tables with values provided in a clean and formatted way.

This makes it convenient to run everything at once, creating the tables and populating them with data.

I combined both table creation queries and the data insertion queries into one unified script, which includes:

1. **Table Creation Statements**:
   - `EmployeeDemographics` table with primary key, `NOT NULL` constraints, and checks for valid age and gender values.
   - `EmployeeSalary` table with a primary key, `NOT NULL` constraints, a `CHECK` constraint for valid salary, and a foreign key relationship linking `EmployeeID` to `EmployeeDemographics`.

2. **Data Insertion Statements**:
   - Insert statements for both tables with values provided in a clean and formatted way.

This makes it convenient to run everything at once, creating the tables and populating them with data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant