Create an Access database with two tables using the graphica
Create an Access database with two tables using the graphical capabilities of the product (vs. SQL). One table is called STUDENTS and has fields for Student_ID, Last_Name, First_Name, Major, DOB (i.e., date of birth), Zip_Code, and GPA. The other table is called ZIP_CODES and has fields of Zip_Code, City, and State. Use appropriate Access data types for all fields. Ensure both tables have primary keys and there is a foreign key in the STUDENTS table referencing the Zip_Code field in the ZIP_CODES table. Populate each table with two records, ensuring that each student has a zip code that matches a value in the ZIP_CODES table. Develop a query that shows the Student IDs of both students along with their last names, first names, date of birth, GPAs, zip codes, cities, and states. Submit the following screen snapshots, in this order and appropriately labeled, in a single Word file: Relationships View showing both related tables Table Design Views of both tables Datasheet Views of both tables showing the two records Query Design View of your query SQL View of your query Datasheet View of the query results At the top of your Word file, include the title of this Critical Thinking assignment, your name, and the date. Screen snapshots can be made by hitting the PrtScrn button on the keyboard and then pasting the captured image into Word. You can use Alt-PrtScrn to capture a single window of interest vs. the entire display on the monitor.
Solution
Creation Tables:
1.create table Students(Student_ID integer, Last_Name varchar(30),First_Name varchar(30), Major char(3),DOB date format(\'yyyy-mm-dd\'),Zip_Code integer(6),GPA float(10,2) );
2.create table ZIP_CODES(Zip_Code integer(6),City varchar(20) ,state varchar(20)),
Note: Primary Keys will not allow duplicates.and redundant data.
Primary key has unique data.primary key length cannot be exceeded than 900 bytes.
A primary key cannot have null value.A table can contain only one primary key constraint.
When we specify a primary key constraint for a table, database engine automatically creates a unique index for the primary key column.
Advantage:The main advantage of this uniqueness is that we get fast access.
FOREIGN KEY: A foreign key is a field or a column that is used to establish a link between two tables.
a foreign key in one table used to point primary key in another table. foreign key will allow duplicates data.
diffrence between Primary Key Vs Foreign Key.
1.Primary key cannot be null on the other hand foreign key can be null.
2.Primary key is always unique while foreign key can be duplicated.
Primary key uniquely identify a record in a table while foreign key is a field in a table that is primary key in another table.There is only one primary key in the table on the other hand we can have more than one foreign key in the table.
