440 Posted Topics
Re: hello, You want to select some data from three tables. This will be done by two inner joins. If you don't tell which columns of the involved tables should be joined together the result will be cartesian product (cross join), that is all columns of 1st table will be joined … | |
Re: Hi, I am back again. Because of "A French vocable got one or more English vocable equivalents and vice versa." there exists a many-to-many relationship between both entities. Therefore this is the correct solution: [QUOTE=DBGuy007;775922] Possibility 1. Table 1: French vocabulary Table 2: English vocabulary Table 3: Translation table containing … | |
Re: Hi 2eXtreme, in another thread [url]http://www.daniweb.com/forums/thread127644.html[/url] there was a similar problem like yours. I gave the advice to solve it with the new with clause. You should carefully compare the table structure and given solution in post #7 with your table structure. I think it is possible to adopt the … | |
Re: Hi rich_m >>> My team( all freshers) are developing a project that will involve many Modules. You must be "sophos ke moros" to carry out such database design successfully, which is every project's most crucial design phase. So wait a year or two until you will have past database design … | |
Re: By tricky triggers, as you may have already figured out. | |
Re: hello, I am glad that you have got inspired by my solutions. Questions: 1. How is your uniqueID computed? 2. Does uniqueID correspond to the date? 3. Isn't there a contradiction in WHERE b.uniqueID < a.uniqueID and your example [code] DB10006 | 05-3-08 | 233.00 | 233.00 DB10007 | 05-3-08 … | |
Re: Hello rich_m, how are you? I am afraid you will have to wait at the Greek calends. Once MySql company had a wonderful oracle clone. It was MaxDB, formerly SAPDB. And lots of people thought they would drop ugly MySql database and replace it by MaxDB. But they returned it … | |
Re: Hello that depends on your specific database system. There are Database systems where you can type in: select myBirthday - now() as "My age is:" ; You need to know the current-date function of your database, for example: today(), now(), currentdate() etc. krs, tesu [QUOTE=aamint;655817]Hi, I'm developing issues database. How … | |
Re: Hello, >>> I installed and configured MySQL on my server and also installed the MySQL ODBC driver (version 5.1). What the problem is now that I couldn't establish a connection, despite that I supplied all the parameters corectly. All I kept getting is "unable to establish a connection: access denied … | |
Re: [QUOTE=veledrom;656042]Hi, How can i pick next or prevoius day in mysql? Any function like curdate() ? Thanks[/QUOTE] next: today + 1 previous: today - 1 | |
Re: Hello What is the primary key of responses, (response_id, range_id)? To ensure referential integrity all foreign keys (fk) must be set up correctly. Diaries ---< questions: diary_id is fk in questions. Questions ---< responses: question_id is fk in responses. Response ---- response_values: because there is one-to-one relationship, response_id (and range_id, … | |
Re: hello [code]SELECT DATEDIFF(DAY, yourBirthday, getdate()) AS silly_days[/code] may work on mssqlserver. krs, tesu | |
Re: hello, >>> "select * from table1 where RAM between ... " Never use *, the sign of slackers! You must always enumerate only those columns you really need for your datagrid! There are lots of reasons for data type mismatch, so it s better you bring in the complete and … | |
Re: Hello, you may have a look at DATE_FORMAT(date, format), especially specifier %p to convert date and time values. krs, tesu | |
Re: Hi, you may try: [code=sql]select * from yourtable where TO_CHAR(your_date, 'MM') in ('01', '03',... ,'12')[/code] krs, tesu | |
Re: hi, how do you access the database? If by ODBC, you should set autocommit OFF. Unfortunately, ODBC's default is ON! krs, tesu | |
Re: Hello Because both products differ in an important property they must have different part numbers. So you are able to manage different quantities, deliverers, prices, taxes etc. You may put them into same category, for example "hard disks" to get a list of all hard disks if necessary. krs, tesu | |
Re: Hi monksorlo what do you mean by subtype/supertype. Does this deal with the concept of Generalization/Specialization of extended entity relationship model? you may state an example. If your professor suggest doing something else just for performance reasons at that very early design stage, you may change professors. krs, tesu | |
Re: hi, there are some discrepancies: 1. What are PD.REFNO, PH1.BGROUP, PS1.REFNO ? 2. Is there a self-join: LEFT JOIN TableC LEFT JOIN TableC C ??? 3. TableC of first left join doesn't have alias. 4. Select has 6 columns but only 3 results are showing. Btw, threefold results may likely … | |
Re: hello, in union clause the column which should be ordered cannot be denoted by column name. Column to be ordered must be specified by its position number like in: [code] select a, b, c from t1 union select x, y, z from t2 order by 2[/code] That orders second column … | |
![]() | Re: Hello dmmckelv, When Edgar Frank Codd invited relational databases his primary idea was to found it on logic algebra and set theory. The rows of relational tables (aka relations) are sets. Therefore, there aren't duplicate rows nor any particular order of rows. From this point of view, "I am looking … |
Re: Hi Finau, If both following statements are true 1. Each table has a column named region_id of compatible data type 2. At least one of those tables has primary key region_id AND all other tables containing region_id that column is attributed to be foreign key. then you may carry out … | |
Re: Hello, in tbl_poems exists a transitive dependency poem-ID -> Author-ID -> Book-ID. Therefore, this table does not satisfy 3NF. fk Author-ID should be removed and inserted into tbl_Book. The result is: tbl_Poems: - poem-ID - pk - Poem-Title - Poem - Book-ID - fk tbl_Book: - Book-ID - pk - … | |
Re: Hi rupak Stay your ground! Knowing as less as possible from that database protects one from becoming infested with badly base database concepts. Try to learn db2, firebird, oracle, postgresql, ms sql server etc, they all are true relational data base systems. krs, tesu | |
Re: So you want to decipher a 160 bit binary HSA1 string? Impossible! (except for hiring some Roadrunner doing brute-force decryption.) | |
Re: [QUOTE=kvdd;642708][code=mysql] SELECT IF TIME(hour_end) > '21:00:00' THEN timediff(time(hour_end),'21:00') AS diff ENDIF FROM `hours` [/code][/QUOTE] What do you think of correct syntax? [code=mysql] SELECT IF ... THEN ... ELSE ... ENDIF AS diff [/code] krs, tesu | |
Re: Hello, 1. how come that in >>> select temp.start, temp.end, temp.gene_name, min(temp.distance) as >>> minimum_distance from (select start_bindsite, end_bindsite, gene_name, >>> abs(gene_start-start_bindsite) as distance from genome, binding_sites group by >>> gene_name, start_bindsite group-by clause contains 2 columns only whereas you select 3 columns? this should produce a true error, if … | |
Re: Hi varun077, Most of your questions including your several performance and maintenance issues will simply get solved if you (re-)design a true relational datamodel based on correct relationships (cardinalities) and effective normalization, as for example: 1. Foreign keys: will appear automatically if relationships are correctly taken into account and implemented … | |
Re: Hello guptaalok12, When Edgar Frank Codd invited relational databases his primary idea was to found it on logic algebra and set theory. The Rows of relational tables (aka relations) are sets. Therefore, there aren't duplicate rows nor any particular order of rows. From this point of view, asking "How To … | |
Re: Hello If your tables are properly designed simple inner joins will solve your problem: select * tbl_site join tbl_state join tbl_trial_site join tbl_user_site. Ok, this result set will contain duplicate columns. To discard them you must replace the asterisk by the list of column names you want to get. Unfortunately, … | |
Re: Ah, you again Did you proceed in understanding EERM? I call people who put a magical, universal "id" column with an auto-increment on all their tables "id-iots" ! (Joe Celko) | |
Re: Hello bajanstar you may try this statement: [code] select receptor as 'ultimate donors, really? Shouldn''t it be ultimate receptors?' from inthebelowtable where receptor NOT IN (select donor from inthebelowtable) [/code] krs, tesu | |
Re: yeah, aaaaaand the ardently demanding question is what does that only mean: >> merge function is not working at all ? Any error message, divide by zero, memory fault, endless loops, computer on strike, or something else, you see? | |
Re: You may study programming languages like FORTH or Postscript how they do computing using stacks. tesu | |
Re: Hi motofoto There is kind of inheritance - in EERM - where we have Generalization / Specialization, such called isa-relationships. Maybe you should first design an EERM. Your implementation idea of isa-relationships is correct, generic data might be collected in a person entity (table), specialized data in additional entities (tables, … | |
Re: Hi qdaddyo you may try this statement: [code=sql] with modi (tn, moda) as (select ticket_number, min(modified_date) from tictac where assignee <> 'NONE' group by ticket_number) , retu (tn, reda) as (select ticket_number, max(return_date) from tictac group by ticket_number) select m.tn, m.moda, r.reda, datediff(day, m.moda, r.reda) as "days" from modi m … | |
Re: [QUOTE=harcaype;639245] [ICODE][B][COLOR="Green"]SELECT[/COLOR][/B] Vio.ViolationList.ViolationCode,Records.[Violation Commited],Vio.ViolationList.FineAmnt,DriverInfo.[Plate Number] ,DriverInfo.[License Number],DriverInfo.[Reg'd Last Name],DriverInfo.[Reg'd First Name],DriverInfo.[Reg'd Middle Name],DriverInfo.[Reg'd Address], DriverInfo.[Address' City Code],DriverInfo.[Reg'd B-Date],DriverInfo.[Conduction Number], DriverInfo.[Vehicle Category],DriverInfo.[Vehicle Type],DriverInfo.[Vehicle Brand] ,Records.[Street Name],Records.[Date] [COLOR="Green"][B]FROM[/B][/COLOR] Vio.ViolationList,DriverInfo,Records [COLOR="Green"][B]WHERE[/B][/COLOR] Records.PlateNo [COLOR="Red"]like[/COLOR] DriverInfo.[Plate Number] [COLOR="Red"]and[/COLOR] Records.[Violation Commited] [COLOR="Red"]like[/COLOR] Vio.ViolationList.ViolationD[/ICODE] In above from clause you are joining the tables ViolationList, DriverInfo and Records … | |
Re: Hello mad pat You need a further table, name it salesitems, where its primary key must be formed from salesID and productID because of many-to-many relationship. Both are also foreign keys. Here can you also place quantity, item price, total price etc. Ok, write the create-table statements for all four … | |
Re: Hi possibly you want that second array of chars behaves like first on, as in: [code] int main() { unsigned char apayload[] = {'H','i',' ','T','h','e','r','e', '\0'}; unsigned char received_payload[]={'H','i',' ','T','h','e','r','e','a', 'b','\0'}; cout << apayload << " "<< received_payload << endl; received_payload[8]='\0'; cout << apayload << " " << received_payload << … | |
Re: Hi dakoris73 A constraint is kind of restriction usually to the range of values of a variable. Given the following create-table statement we can detect several constraints: create table raint(id integer UNIQUE, NOT NULL, day char(10) CHECK(day IN ('Monday', 'Tuesday', 'wednesday', . . .) ); UNIQUE This constraint assures that … | |
| |
Re: hi If you were able to redesign table Markets like that: (PrjID, MarkedID, Market), where at least all three attributes be part of markets' primary key, the query you are looking for and generating where clause at runtime would really be simple: select distinct p.PrjID, PrjName from projects p inner … | |
Re: Hello michael123 I am afraid, there is no direct way to get rid of duplicate rows. But you can populate a new table with distinct rows from your given table only, for example: [code=sql] -- create your table create table dudel(name varchar(50)not null, sex char(1), age integer); -- inserte some … | |
Re: Hello depending on how many "grams" will be processed, that is eliminating duplicates, comparing two sets of "grams", hashing method is best method, it is of O(1). And compared with other searching methods it is really easy to program. Guess how many "grams" of each set need to be compared … | |
Re: Hi Do below statements not work on mysql? [code=sql] DELETE FROM accounts WHERE usrn = 'caughtusername'; COMMIT; [/code] As nav33n already suggested. krs, tesu | |
Re: Hello In subselect you select b.Airtime and then you compare it with a.Airtime but between them there are still large differences. try these changes: AND a.Airtime -- you want to get airtime with differences greater than 30 sec IN (SELECT a.Airtime FROM stationschedule b WHERE TIME_TO_SEC( TIMEDIFF( RIGHT( a.Airtime, 9 … | |
Re: Hi, So you have a table consisting of 6 columns: Column Name Data Type Length Turnover where the latter should be of decimal data type??? What do you mean by "that the max value could be limited to 9999,99" ? Should output format be restricted to 9999.99 (decimal(8,2)) or the … | |
Re: [QUOTE=TheBeast32;609145]Hi, is there a data type larger than unsigned long long int except double? I don't want double or float because I need to keep it as precise as possible. I also need it to be able to do modulus. How would I do this?[/QUOTE] GMP is uniquely great. Yet, … |
The End.