Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I have a school project and i hit a small snag . I just learned some basic mysql and i can work with single tables/row such as register users , validating logins and outputting all the data in a table.
I now have a more complex issue and i'm not very sure how to proceed .
I need to create a 'courses' that have several subsections such as :
(1) A course can have different lectures for each semester
(2) A lecture has its specific tutorials & labs ( more than one )
I know how to create a single row such as : username , frst name , last name , email etc....
But for the stucture below - i'm not really sure how to do this. I don't have a pre-existing code yet as i have not yet decided how to proceed .
i'm thinking about adding more than one data in the fields like : sections ="TA,TB" but i read that its not recommended in mysql
(source: 4.ii.gl)
(source: 2.ii.gl)
You schould make multiple tables.
One for courses. One for lectures and one for tutorials etc.
Then you bind them togheter woth unique IDs
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I wanna build a web app which will store a lot of data for each user, so I've got a question, which solution is better:
create a separate database for each user
create one big database and in every table add a column with user id
?another option?
Thanks!
There is no question that creating a "big" table with a column for the user id is the way to go. SQL is optimizes to handle data in tables, not to handle zillions of tables.
Here are some reasons why:
Performance. Having a separate table for each user means that you will have lots of empty space on data pages.
Combining data across all users. Having separate tables means that your queries will be really complicated.
Maintenance. Having separate tables means that adding indexes, new columns, and so on is a nightmare.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I'm building a website that contains articles, these articles won't be shown until the user is logged in, I'm planning to add two buttons, the first one is called "follow this article", the second is meant to make the article as a favourite. My question is how can I structure that in my database?
Should I just add a table that contains id_article, id_user, followed(1 or 0) and favourite (1 or 0), or is there another solution that would let me economize more memory space?
NOTE: My website will have lots of articles that will be visited by a lot of users.
Make two separate relations: articles_followed (id, id_article, id_user) and articles_favourite (id, id_article, id_user). This will give you enough flexibility in:
adding new attributes, specific for each relation,
sharding your database (at some point): it'd be easier to move one relation from another since they are not depending on each other,
concurrent update: you can use separate locks on these two, in addition, you'll have fewer issues with transaction visibility,
you don't need to keep is_followed or is_favourite flag: if there's an entry, then it means that article is followed (once unfollowed, simply remove the line)
Think about your domain classes structure -- which option would be more convenient to code? I bet, in case of two separate relations, it would be clearer.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I am in need of creating a table that will get its data from a database (this is done:) ).
The users must be able to filter the table if they want to find specific rows based on the their input.
The table will have around 33 columns which not all of them will be visible, but the user can drag and drop new columns whenever he likes. and be able to filter the table using values from these columns as well.
The table will look like this and every time the user inputs something on the top of a column then the table will get filtered based on that column. also multiple filters can be placed.
Any suggestions on how to do this? is it even possible?
I would like suggest you to use http://yadcf-showcase.appspot.com/DOM_source_chosen.html jquery plugin for datatable also it works with ajax source
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I need a web-service which allows admins to insert new data and viewers to see this data-tables. Therefore at first i need a database (Mysql ?). Is a mySql db on a server the right choice? Afterwards a website should be connected to this db, where users can see specific tables and admins can add new lines into this tables. Finally this tables should be able to only show the last xy-lines of the respective table.
Use-case: I have a restaurant, and when I get orders, i want to provide a simple table where the telephone-workers can add new orders (e.g. 3x pizza salami); afterwards this table is opened with view-rights on a display in the kitchen. So the chefs can create the orders.
Which database is the optimal here?
What kind of web-service is the right and how is this connected and set up?
You can use MySQL or SQL Server. And you can use Web Pages instead of web-service.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
In Excel, records are entered in single rows going across, and columns.
I have a searchable online Mysql (using PHP) working database, with a single table to query same which so far is working great. All my online input queries work great, except for one which eludes me to date:
I would like to Query & ECHO results of each Company related information ONCE, followed by each person that works within each Company - then, next Company data again followed by all employees within it, Etc... all in one query without repeating the Company information again which is redundant.
I have been tried my best to research the above for a few weeks before asking for your help. I would appreciate any guidance you may be able to offer me related to this task - Thank you in advance for your time and guidance !
Here's a possible solution: Do a SELECT DISTINCT on your "station" field. This will return you a set of all unique stations.(read about distinct selections here)
Put that data into an array called $uniqueStations or something.
Then you can use a foreach loop to go through each value in $uniqueStations and echo out employee data with a different SELECT based on the unique station. (More on foreach here)