Update SQL Basics Create Table and Insert Into#7
Open
Imran-imtiaz48 wants to merge 1 commit intoAlexTheAnalyst:masterfrom
Open
Update SQL Basics Create Table and Insert Into#7Imran-imtiaz48 wants to merge 1 commit intoAlexTheAnalyst:masterfrom
Imran-imtiaz48 wants to merge 1 commit intoAlexTheAnalyst:masterfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I combined both table creation queries and the data insertion queries into one unified script, which includes:
Table Creation Statements:
EmployeeDemographicstable with primary key,NOT NULLconstraints, and checks for valid age and gender values.EmployeeSalarytable with a primary key,NOT NULLconstraints, aCHECKconstraint for valid salary, and a foreign key relationship linkingEmployeeIDtoEmployeeDemographics.Data Insertion Statements:
This makes it convenient to run everything at once, creating the tables and populating them with data.