relational-database

MySQL best approach for db normalising, relationships and foreign keys

六眼飞鱼酱① 提交于 2019-12-02 07:38:18
There is an username/password verification step first then the database has following structure ^ is primary key * uses foreign key 1.StudentDetails table =========================================================================== ID^| Username | Password | Email | Address * | Website |Comments ====+============+==========+=============+===========+=========+========== 1 | xxxxxxxxxx | xxxxxxx | xx@xxx.xxx | 1 | http:// | text 2.Submissions table =========================================================================================== ID^|Username*|SubmitDate|SelectedCourse*|Price*|Promotion

Deciding whether a relation is 3NF or 2NF

北慕城南 提交于 2019-12-02 06:47:46
From the Database Management Systems book: given the relation SNLRWH (each letter denotes an attribute) and the following functional dependencies: S->SNLRWH (S is the PK) R->W My attempt: First, it is not 3NF: for the second FD, neither R contains W, nor R contains a key, nor W is part of a key. Second, it is/not 2NF. If we examine the second FD, W is dependent on R, which in turn is not part of a key. STUCK. 2NF is violated if some proper subset of a candidate key appears as a determinant on the left hand side of one of your (non-trivial) dependencies. Ask yourself whether any of your

How to limit the storage size of an Individual MySQL Database

半腔热情 提交于 2019-12-02 06:35:52
问题 I want to be able to place limits on the storage size an individual MySQL database (for example 2GB per database). Was this able to be done? I'm unable to a find specific MySQL configuration that allows this. Specifically I want to be able to do this on AWS RDS Instance - so any knowledge related to this would be helpful too. Any help or guidance wether this could be done would be appreciated. 回答1: This question was asked almost 10 years ago: MySQL schema size I won't close your question as a

Reading info from sqlite database, Syntax? How do I use it in html5 webapp?

。_饼干妹妹 提交于 2019-12-02 06:24:45
问题 I have a webapp that I'm building, and have just started with SQLite. I have been able to create my form, open the database I created, create the table, and fields i need, and enter data into the fields. Now I'm trying to read the data back out with a SELECT statement, to show it on screen and as a list of the columns. I just don't know the syntax for the SELECT statemnt in javascript or HTML5 beyond 'SELECT * FROM MyTable'...I know it can be done, just need some help with the syntax of

How to limit the storage size of an Individual MySQL Database

試著忘記壹切 提交于 2019-12-02 04:45:29
I want to be able to place limits on the storage size an individual MySQL database (for example 2GB per database). Was this able to be done? I'm unable to a find specific MySQL configuration that allows this. Specifically I want to be able to do this on AWS RDS Instance - so any knowledge related to this would be helpful too. Any help or guidance wether this could be done would be appreciated. This question was asked almost 10 years ago: MySQL schema size I won't close your question as a duplicate because it has been long enough that it deserves a fresh answer. Nothing has changed. There is no

BCNF: Looking for example that actually uses superkey instead of candidate key

落花浮王杯 提交于 2019-12-02 04:14:39
The definition of the Boyce–Codd normal form states that the determinants of all non-trivial functional dependencies have to be superkeys. All the examples for relations in BCNF I found make use of candidate keys. I am looking for an example that actually has a superkey as determinant which is not a candidate key. I fail to come up with a relation that only uses superkeys which can't be transformed to use candidate keys. Let's say we have a relation with an candidate key and an additional functional dependency with a superkey as determinant. R1(A,B,C) {A} A,B -> C This additional FD is

Decoupling MySQL data versus ease of use

久未见 提交于 2019-12-02 04:11:55
问题 Assume a simple database for hotel reservations with three tables. Table 1: Reservations This table contains a check-in and check-out date as well as a reference to one or more rooms and a coupon if applicable. Table 2: Rooms This table holds the data of all the hotel rooms with prices per night and number of beds. Table 3: Coupons This table holds the data of all the coupons. Option #1: If you want to get an overview of the reservations for a particular month with the total cost of each

SQLite delete with table alias [duplicate]

做~自己de王妃 提交于 2019-12-02 03:33:14
问题 This question already has answers here : Sqlite delete query error (3 answers) Closed 6 years ago . I am trying to alias a table in SQLite, for example by the following command: (it is from the book i am reading"Database Management Systems by Ramakrishnan") DELETE FROM Students S WHERE S.sid=12546 This code gives a syntax error. Without aliasing, the following code works: DELETE FROM Students WHERE sid=12546 But, if i want to alias the table, what should i do? Can anyone help? Thanks 回答1: The

Relational UML Diagram inspired by SO

最后都变了- 提交于 2019-12-02 01:45:57
问题 My homework was to create a relational UML diagram about a discussion site. I used the SO schema, and I did some modifications: removed Age in the User Information added representatives, which allows users to categorise posts by their usernames (voluntary) Otherwise, the schema is rather similar, but rudimentary. How would you improve it? Clarification The main idea of representatives is to categorise posts. The list contains only a handful possible names. In contrast to badges, the idea is

Reading info from sqlite database, Syntax? How do I use it in html5 webapp?

ε祈祈猫儿з 提交于 2019-12-02 01:28:22
I have a webapp that I'm building, and have just started with SQLite. I have been able to create my form, open the database I created, create the table, and fields i need, and enter data into the fields. Now I'm trying to read the data back out with a SELECT statement, to show it on screen and as a list of the columns. I just don't know the syntax for the SELECT statemnt in javascript or HTML5 beyond 'SELECT * FROM MyTable'...I know it can be done, just need some help with the syntax of getting the results onto the screen. I start with this. var db = window.openDatabase('TabOrder', '', 'Bar