« first day (2272 days earlier)      last day (386 days later) » 

7:35 AM
Hello.
I need a bit of help with the design of my database.
I have 3 objects. To be concrete, these are ITEM, BOX, PALLET.
Each of these must have their own table as they have their unique columns.
Each ITEM can have multiple combinations with BOX and each BOX can then have a unique combination with PALLET.
I am wondering how to relate these three. I considered a many-to-many table between these three tables, but can't figure out if that's the way to go. If there was a many-to-many table between all three of them each combination would have a unique ID. Is that the right way to go?
 
 
6 hours later…
1:53 PM
@alkra_dev hmm, let's go back to English
is it accurate to say that a pallet can have many boxes, but a box can only be on one pallet?
I'm guessing it's accurate to say that a box can have many items
Which is true: an item can only be in one box, or an item may be in many boxes at once?
 
2:26 PM
hi
 
All relationships can be many to many. An item may fit into various boxes and a box can fit various items. Boxes can fit various pallets and vice versa. Its a many-to-many either way you look at it. Does it make sense to make these combinations unique by joining them into one table and giving each combo an id? Or should i consider a redesign?
 
 
1 hour later…
3:32 PM
An important thing I forgot to mention here. The items will on
ly be placeholders for standard information about the product. That goes for boxes and pallets as well. They will not be individual items or at least for better understanding there wont be too many (like 20 tops). Same goes for boxes (only holders for some dimensions and with which pallets and items they combine)
 
4:19 PM
@TehShrike, host means IP address right? If yes, I've already mentioned the IP for -h option (172.19.18.248).
 
@learner nope, host is a column in the mysql.user table
@alkra_dev so boxes have many items and an item can be in many boxes? And pallets can have many boxes and a box can be on many pallets?
@alkra_dev okay, that makes sense.
 
I have two table program(p_id(pk)AI, program_name and another table graduate_survey(id(pk)AI,total_PO1,total_PO2,session,p_id(fk). In the program table values are already inserted as

p_id Program_name
1 B.tech CSE
2 B.tech IT.
..so on. I select from a drop down list B.tech CSE and then redirect to the survey form. I enter the total_PO1, total_PO2 there and submit it.Now i want to insert in the graduate_survey table where in the fk field the p_id of B.tech CSE should automatically enter so that i can know the survey is done for which program..Is there any query in MySQL to do that?
 
@alkra_dev So yeah, if those are all many-to-many, then you'll need those extra tables: a pallet_box table representing the relationships between pallets and boxes, and a box_item table
@DebasishChoudhury what exactly do you want to happen when you insert into the graduate_survey table?
 
i want the p_id of program table to be inserted automatically into graduate_survey p_id field which is foreign key of p_id of program table.
so that i can assure that for which program, the survey has been done.
 
4:55 PM
Hello, I have a rather short question. I want to dynamically order a result from my database according to a evaluation with case when. My try looks like this but it does not even produce an error if I want to order by a non existing column....
https://pastebin.com/h4nUZYc7
Any help would ne sp nice
 
 
2 hours later…
6:58 PM
@DebasishChoudhury you can't do that with foreign keys, but you can do that with a trigger on the program table.
@JRsz I'm guessing that's possible, but from your example, I can't figure out exactly what you're trying to do
what are those numbers (2, 4, 7) supposed to represent?
 
they are just for testing purposes. but I figuered out a way to sort of get around this. currently I am facing another problem which has been bugging me for some time now:
0
Q: MySQL show columns query to string

JRszI am looking for a way to convert the result of a query to a string. The query can be DESC entries; or SHOW COLUMNS FROM entires; For example, both yield the same result if I execute them in the CLI which is: +---------+-------------+------+-----+---------+----------------+ | Field | Typ...

I need to get the column names from a table in a database (I know both names) as one string. I do not have access to the database and I do not have access to any Code. All I have is a blind sql injection vulnerability. Either I can figure out how the columnnames are or I fugure out how to concat multiple columns
 
7:58 PM
@JRsz you want to take a query that returns multiple columns and multiple rows, and return its results as a single column in a single row?
 
that is exactly what I need
But at this point I doubt that it is even possible
 
8:13 PM
@TehShrike can you give that trigger? any example how it is set.
 
 
2 hours later…
9:46 PM
@DebasishChoudhury What database engine are you using?
 
@KARTHIKEYAN.A sup
 
10:03 PM
hi have doubt in mysql
1) Which country sold most Watches in year 2013

2) Which Order method type generated most revenue every year .

3) List the average number of products sold in each country for every Quarter.
i want sql query for thins
three
Retailer country Order method type Retailer type Product line Product type Product Year Quarter Revenue Quantity Gross margin
United States Fax Outdoors Shop Camping Equipment Cooking Gear TrailChef Deluxe Cook Set 2012 Q1 2012 59628.66 489 0.34754797
United States Fax Outdoors Shop Camping Equipment Cooking Gear TrailChef Double Flame 2012 Q1 2012 35950.32 252 0.4742745
United States Fax Outdoors Shop Camping Equipment Tents Star Dome 2012 Q1 2012 89940.48 147 0.35277197
United States Fax Outdoors Shop Camping Equipment Tents Star Gazer 2 2012 Q1 2012 165883.41 303 0.28293788
@TehShrike
 
I am using MySQL....
 
ok np
 
11:01 PM
@T
@TehShrike can you help me
 

« first day (2272 days earlier)      last day (386 days later) »