Question

Define a table with the following properties representing a voter voting in an election. Create a...

Define a table with the following properties representing a voter voting in an election.

Create a unique id for the table

Foreign key pointing to the voter table.

Foreign key pointing to the election table.

Create a field or fields representing the time and date of the voter's vote.

Homework Answers

Answer #1

Below is the DDL statement for voter table

1.Table Name :voting

create table voting(
votingID int primary key,
VoterID int,
electionID int,
votingDateTime datetime,
foreign key (VoterID) references Voter(VoterID),
foreign key (electionID) references election(electionID));

  • Here VoterID is primary key in the Voter table which acts as foreign key in the voting table
  • electionID is primary key in the election table which acts as foreign key in the voting table
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write a script to create the following tables with attributes as specified(SQL) Customer table with Customer’s...
Write a script to create the following tables with attributes as specified(SQL) Customer table with Customer’s id, name, address, city as varchar, customer’s date of birth as date type and zip code number where the customers id is the primary key in the table, name and date of birth are mandatory. Id has a 10-character limit, name, address and city have a 50-character limit, zip has a 5-character limit Product Table with Product id, description and finish as varchar, price...
car dealership needs to design a database for their business. It is assumed there are three...
car dealership needs to design a database for their business. It is assumed there are three tables in the database with 6 fields in each table. Give your suggestions for the most necessary fields and their proper types, propertis and PK (primary key) / FK (foreign key) You can enlarge the answer window this way. Click in the answer box, then on the bottom right of the answer box, click on the triangle of dots icon and drag the window...
how would the data insert MYSQL query for below table look like: CREATE TABLE Appointments( AppointmentID...
how would the data insert MYSQL query for below table look like: CREATE TABLE Appointments( AppointmentID int NOT NULL, Date Time datetime, Details varchar(100), Remarks varchar(200), POwnerID int, TenantID int, SerAgtID int, PRIMARY KEY (AppointmentID), FOREIGN KEY (POwnerID) REFERENCES Property Owners (POwnerID), FOREIGN KEY (TenantID) REFERENCES Tenants (TenantID), FOREIGN KEY (SerAgtID) REFERENCES Service Agents (SerAgtID));
-- Define the database CREATE TABLE Product ( ProdName VARCHAR2(10) NOT NULL, Price INTEGER NOT NULL,...
-- Define the database CREATE TABLE Product ( ProdName VARCHAR2(10) NOT NULL, Price INTEGER NOT NULL, CONSTRAINT PRODUCT_PK PRIMARY KEY (ProdName) ); CREATE TABLE Customer ( ID INTEGER NOT NULL, ProdName VARCHAR2(10), Rating INTEGER, CustName VARCHAR2(10), CONSTRAINT CUSTOMER_PK PRIMARY KEY (ID) ); CREATE TABLE Buys ( ID INTEGER NOT NULL, ProdName VARCHAR2(10) NOT NULL, Quantity INTEGER NOT NULL, CONSTRAINT BUYS_PK PRIMARY KEY (ID, ProdName) ); ALTER TABLE Buys ADD CONSTRAINT PRODUCT_BUYS_FK FOREIGN KEY (ProdName) REFERENCES Product (ProdName) NOT DEFERRABLE; ALTER...
Do a queries batch 1 (QB1): queries requiring a single table for the following project idea:...
Do a queries batch 1 (QB1): queries requiring a single table for the following project idea: Description: This is a solution that saves student records for an educational institution. I will keep their information, subjects, fees, and their academic progress. My DBMS based solution will allow the client to save a lot of time and effort. My design goal is to separate files for each student where the data will store information about the student. Schema: Student's Information Fees Subjects...
In HTML and Javacript: Create three columns. Column #1: Include input fields for the following... Text...
In HTML and Javacript: Create three columns. Column #1: Include input fields for the following... Text field (with labelling) to retrieve a student's FIRST name Text field (with labelling) to retrieve a student's last name Text field (with labelling) to retrieve a student's id (number) A checkbox for country designation with no check designating a "Domestic" student and checked designating an "International" student. A text field should be placed beside or under the check box with the text field containing...
Make Java program with the following tasks: 1. Create a new database called DTCC 2. Create...
Make Java program with the following tasks: 1. Create a new database called DTCC 2. Create a table called Students in the DTCC database with the following fields:     Student_ID    CHAR (10) ** make sure to set this field as the primary key     LastName      CHAR(20)     FirstName     CHAR(15)     PlanOfStudy CHAR(25)     GPA               Double 3. Insert 5 records into Students table: 899090111    Rothlisberger   Ben          CIT                                       3.7 129020202    Manning          Peyton     Computer Programming       3.8 890101030    Brady               Tom         Accounting                           3.4 980191919    Rodgers           Aaron       Networking                          3.2...
1. Which of the following is NOT a type of data anomaly? a. Insertion b. Transformation...
1. Which of the following is NOT a type of data anomaly? a. Insertion b. Transformation c. Deletion d. Modification 2. Functional dependency has the following characteristics EXCEPT a. Attribute Y is functionally dependent upon attribute X, if the value of X uniquely determines the value of Y b. It's a constraint between two tables c. It's a constraint between two attributes (columns) d. Represented as Determinant(s) -> Dependent(s) 3. The definition of a partial dependency is a.One or more...
The following is for a Java Program Create UML Class Diagram for these 4 java classes....
The following is for a Java Program Create UML Class Diagram for these 4 java classes. The diagram should include: 1) All instance variables, including type and access specifier (+, -); 2) All methods, including parameter list, return type and access specifier (+, -); 3) Include Generalization and Aggregation where appropriate. Java Classes description: 1. User Class 1.1 Subclass of Account class. 1.2 Instance variables __ 1.2.1 username – String __ 1.2.2 fullName – String __ 1.2.3 deptCode – int...
Create a relational model and ER diagram based on the following info. Emerald Realty Group, Inc....
Create a relational model and ER diagram based on the following info. Emerald Realty Group, Inc. is a local real estate company that is specialized in leasing office space to businesses. The company does not own all the properties it leases. The company has its own suppliers and customers. We refer to the person or the company that owns the office space as a supplier. A customer is the person or the company that rents the office space. Emerald Realty...