Compare PHP code used to create and update two-dimensional arrays to another programming language. Which is easier and more efficient? Why? Can be compared to any other well used language.
In: Computer Science
Create tables according to the mapping. Add 2 records to each. Create 5 queries for database of 3 table joins to use most of the tables or group of tables in database. You should not have tables that are of no use.
Student(ssn, name, major)
Class(classID, name, f_ssn)
Faculty(ssn, name, office_num, dept_id)
Department(Dept_id, office_num, f_ssn)
Enroll(s_ssn, classID, grade)
Professor(f_ssn, alma-mater, tenured)
Instructor(f_ssn, term_degree, type)
Lecture(classID, method)
Lab(classID, location)
Person(ssn, dob, gender)
In: Computer Science
INTRO TO DATABASE
Consider the Sailors-Boats-Reserves database described below.
Sailors(sid: integer, sname: string, rating: integer, age: real)
Boats(bid: integer, bname: string, color: string)
Reserves(sid: integer, bid: integer, day: date)
Write each of the following queries in SQL.
1. Find the names and ages of sailors who have reserved at least two boats.
2. For each boat reserved by at least 2 distinct sailors, find the boat id and the average age of sailors who reserved it.
In: Computer Science
Presence on the Web and Internet are critical components of just about any business, large or small. However, having a website presence can increase the security risks and threats to which an organization is subject. Consider the questions below and respond to at least two of them.
In: Computer Science
In: Computer Science
Company X database
Create an ER Diagram using UML notation for the following tables, then write out in the Relational model.
Company X is a manufacturing company that binds and sells books. They have hired you to create database to track their Employees, Products, customers and their orders. All employees work with book Binding, Only some are designated as Reps for customers. Reps may have many customers.
But each customer can only have 1 rep. They count to record each Books author, title, price, published year, publisher, and ISBN#
In: Computer Science
Locking methods are one of the most common techniques used in concurrency control. There are different levels of lock use.
Make sure you clearly write down (a), (b) followed by your answers.
[6 marks] (a) Use the following scenario to illustrate and explain how a table-level lock and a page-level lock work.
Scenario:
Transaction 1 (T1) wants to update row 5 in Table A
Transaction 2 (T2) wants to update row 2 in Table A
Note: Page 1 contains rows 1-3 in Table A and Page 2 contains rows 4-6 in Table A
[4 marks] (b) Compare the advantages and disadvantages of a table-level lock and a page-level lock.
In: Computer Science
Construct an ER diagram for a database system that models data of the following situation. You are creating a database for a stock trading company. The company has clients and financial officers. Each client is either an individual or another legal entity (e.g. another company). A client has a name, social security number, address, contact information, the date that entered the database system, and also a ranking that the trading company keeps internally (high, med, low). Financial officers have a name, employee ID, social security number,annual salary, bonus, bonus. There are contracts that one client (or more clients together in one contract) have with the hedge fund. Each contract has a contract id, budget and task. For One constraint is that each contract has exactly one financial officer that is responsible and at least one client. There can also be more than 1 financial officer in 1 location. There is one office location for hedge fund with address and phone number. Draw an ER diagram for the above description.
In: Computer Science
Write a C program that creates a database of plant height samples. In this scenario a researcher enters a name of a group/type of plants, and heights for each plant in the group/type Use input will be stored in a database file, which should be a file called database.csv and should be in the following formatPlant1, number_of_samples, sample1, sample2, sample3 ...Plant2, number_of_samples, sample1, sample2, sample3 ...Plant3, number_of_samples, sample1, sample2, sample3 ...Lines starts with the name of a plant type, then an integer indicating the number of following samples. Each sample represents the height of a plant.In your program you should declare a function “input_sample_set” that prompts the user to input plant name and sample count. In this function dynamically allocate memory an array of ints for each plant sample and read in each sample value. Append the data to the database file. Prompt the user “y” or “n” to continuously re-run “input_sample_set” if y is entered. Make sure you deallocate memory after each run of “input_sample_set” to avoid memory leaks.
In: Computer Science
Prepare a 400 words essay:
You are a participant in an information systems project to design a vehicle theft database for a state law enforcement agency. The database will provide information about stolen vehicles (e.g., autos, golf carts, SUV, and trucks), with details about the vehicle theft as well as the stolen vehicle itself. These details will be useful to law enforcement officers investigating the vehicle theft.
- Identify 10 data attributes you would capture for each vehicle theft incident. How many bytes should you allow for each attribute? Give an example of the data you would store in each field.
- Specify which attribute from your list you designate as the primary key
- Discuss briefly: should the database include data about the status of the theft investigation? If so, what sort of data needs to be included?
- Discuss briefly: Can you foresee any problems with keeping the data current? Explain
Please new answer, about 400 words.
In: Computer Science