- How would you get the total number of transactions that occurred on March 1, 2000?
- SELECT COUNT(Transaction_ID)
- FROM Transactions
WHERE Transaction_Date = '20000301";
Day 11
- Imagine that you have a table called Orders, and you want to update it while no
other threads can read from it. You also have a table called Products, which you
want to read from but not update. Write the syntax for appropriate locking and
unlocking of these tables. - LOCK TABLES orders WRITE, products READ;
- ...
UNLOCK TABLES; - Consider each of the following scenarios. In which would you consider applying a key
to the table? Would you use a unique or non-unique key? - A table containing the birthdays of all of the people you know. Your
computer accesses it once a day to see if it's anyone's birthday today,
and, if so, emails him or her a greeting.
A non-unique key - A table of products available to order from your online shop. Duplicates
are not allowed.
A unique key - A table that records the sales tax applied to products sold. It is written to
each time a product is sold, but read from only once per quarter.
No key
Day 12
- List the advantages and disadvantages to using an interface as opposed to the
MySQL Monitor program.
Advantages:
Interfaces allow you to perform complex database operations
programmatically.
They allow you to control what is entered into your database and
perform error checking.
Disadvantages:
You have to know a programming language to create the interface.
The development cycle is long. - What are the basic requirements for a database connection?
Server name or IP address, username and password, database name.
Day 12
- List the advantages and disadvantages to using an interface as opposed to the
MySQL Monitor program.
Advantages:
Interfaces allow you to perform complex database operations
programmatically.
They allow you to control what is entered into your database and
perform error checking.
Disadvantages:
You have to know a programming language to create the interface.
The development cycle is long. - What are the basic requirements for a database connection?
Server name or IP address, username and password, database name.
Day 14
- Create a Perl script that takes a request from the user and displays values from the
database based on the given value. For example, with the Meet_A_Geek
database, create a Web page that allows a person to see a list of customers based